<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="author" content="二口丝连连二口，十八相与与十八">
    
    <meta name="description" content="一花一草一世界">
    
    
    
    
    
    
    <title>JavaScript的一些常见基础用法（一） | Tlin Blog</title>
    <link href=”“ rel=”prefetch” />

    <link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/aos.css">
<link rel="stylesheet" href="/css/style.css">
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/aos.js"></script>
    <script src="/js/highslide/highslide-full.min.js"></script>
    <link rel="stylesheet" href="/js/highslide/highslide.css">
    <style type="text/css">
        @media (max-width: 768px) {
            body {
                background-color: #f0f0f0;
                background: url('/imgs/xsbg.gif');
                background-attachment: fixed;
            }
        }
    </style>
    
    <!--<script type="text/javascript">
      if (document.images) {
        var avatar = new Image();
        avatar.src = '/imgs/avatar.jpg'
        var previews = 'preview1.jpg,preview2.jpg,preview3.jpg'.split(',')
        var previewsPreLoad = []
        for(var i = 0; i < length; i++) {
          previewsPreLoad.push(new Image())
          previewsPreLoad[previewsPreLoad.length - 1].src = '/imgs/preview' + previews[i]
        }
      }
    </script>-->
</head>
<body>
    <!-- 背景轮播图功能 -->
    <section class="hidden-xs">
    <ul class="cb-slideshow">
        <li><span>天若</span></li>
        <li><span>有情</span></li>
        <li><span>天亦老</span></li>
        <li><span>人间</span></li>
        <li><span>正道</span></li>
        <li><span>是沧桑</span></li>
    </ul>
</section>
    <!-- 欧尼酱功能, 谁用谁知道 -->
    
    <div class="gal-menu gal-dropdown">
    <div class="circle" id="gal">
        <div class="ring">
            <a href="/" class="menuItem" style="left: 50%; top: 15%;">首页</a>
            
            <a class="menuItem" style="left: 80.3109%; top: 32.5%;">下一页</a>
            
            <a href="/archives" class="menuItem" style="left: 80.3109%; top: 67.5%;">归档</a>
            <a href="javascript:window.location.reload()" class="menuItem" style="left: 50%; top: 85%;">刷新</a>
            <a href="/message" class="menuItem" style="left: 19.6891%; top: 67.5%;">留言板</a>
            
            <a class="menuItem" style="left: 19.6891%; top: 32.5%;">上一页</a>
            
            <a class="menuItem" style="left: 50%; top: 50%;">自动复制</a>
        </div>
        <!-- <audio id="audio" src="/imgs/oni.mp3"></audio> -->
    </div>
</div>
<script>
    // document.getElementById('copy').onclick=function(){
document.onmouseup=function(){
    var txt = window.getSelection?window.getSelection():document.selection.createRange().text;
    document.execCommand("Copy") 
}
    // }
</script>
    
    <header class="navbar navbar-inverse" id="gal-header">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target=".bs-navbar-collapse"
                    aria-expanded="false">
                <span class="fa fa-lg fa-reorder"></span>
            </button>
            <a href="/">
                
                <style>
                    #gal-header .navbar-brand {
                        height: 54px;
                        line-height: 24px;
                        font-size: 28px;
                        opacity: 1;
                        background-color: rgba(0,0,0,0);
                        text-shadow: 0 0 5px #fff,0 0 10px #fff,0 0 15px #fff,0 0 20px #228DFF,0 0 35px #228DFF,0 0 40px #228DFF,0 0 50px #228DFF,0 0 75px #228DFF;
                    }
                </style>
                <!-- 这里使用文字(navbar_text or config.title) -->
                <div class="navbar-brand">Tlin</div>
                
            </a>
        </div>
        <div class="collapse navbar-collapse bs-navbar-collapse">
            <ul class="nav navbar-nav" id="menu-gal">
                
                
                <li class="">
                    <a href="/">
                        <i class="fa fa-home"></i>首页
                    </a>
                </li>
                
                
                
                <li class="">
                    <a href="/archives">
                        <i class="fa fa-archive"></i>归档
                    </a>
                </li>
                
                
                
                
                <li class="dropdown">
                    <!-- TODO 添加hover dropdown效果 -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" data-hover="dropdown">
                        <i class="fa fa-list"></i>分类
                    </a>
                    <ul class="dropdown-menu">
                        
                        
                        <li>
                            <a href="/categories/音频-视频/">音频 视频</a>
                        </li>
                        
                        <li>
                            <a href="/categories/有趣小东西/">有趣小东西</a>
                        </li>
                        
                        <li>
                            <a href="/categories/hexo/">hexo</a>
                        </li>
                        
                        
                        <li>
                            <a href="/categories">...</a>
                        </li>
                        
                        
                    </ul>
                </li>
                
                
                
                
                
                <li class="dropdown">
                    <!-- TODO 添加hover dropdown效果 -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" data-hover="dropdown">
                        <i class="fa fa-tags"></i>标签
                    </a>
                    <ul class="dropdown-menu">
                        
                        
                        <li>
                            <a href="/tags/audio-video/">audio video</a>
                        </li>
                        
                        <li>
                            <a href="/tags/funny/">funny</a>
                        </li>
                        
                        <li>
                            <a href="/tags/hexo/">hexo</a>
                        </li>
                        
                        
                        <li>
                            <a href="/tags">...</a>
                        </li>
                        
                        
                    </ul>
                </li>
                
                
                
                
                <li class="">
                    <a href="/about">
                        <i class="fa fa-user"></i>关于我
                    </a>
                </li>
                
                
                
                <li class="">
                    <a href="/message">
                        <i class="fa fa-heart"></i>留言板
                    </a>
                </li>
                
                
            </ul>
        </div>
    </div>
</header>
    <div id="gal-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 gal-right" id="mainstay">
                    
<article class="article well article-body" id="article">
    <div class="breadcrumb">
        <i class="fa fa-home"></i>
        <a href="/">Tlin Blog</a>
        >
        <span>JavaScript的一些常见基础用法（一）</span>
    </div>
    <!-- 大型设备详细文章 -->
    <div class="hidden-xs">
        <div class="title-article">
            <h1>
                <a href="/2019/03/05/javascript/basic1/">JavaScript的一些常见基础用法（一）</a>
            </h1>
        </div>
        <div class="tag-article">
            
            <span class="label label-gal">
                <i class="fa fa-tags"></i>
                
                <a href="/tags/javascript/">javascript</a>
                
            </span>
            
            <span class="label label-gal">
                <i class="fa fa-calendar"></i> 2019-03-05
            </span>
            
        </div>
    </div>
    <!-- 小型设备详细文章 -->
    <div class="visible-xs">
        <center>
            <div class="title-article">
                <h4>
                    <a href="/2019/03/05/javascript/basic1/">JavaScript的一些常见基础用法（一）</a>
                </h4>
            </div>
            <p>
                <i class="fa fa-calendar"></i> 2019-03-05
            </p>
            <p>
                
                <i class="fa fa-tags"></i>
                
                <a href="/tags/javascript/">javascript</a>
                
                
                
            </p>
        </center>
    </div>
    <div class="content-article">
        <h3 id="本篇文章主要总结一些在实际应用中常见的基础用法。"><a href="#本篇文章主要总结一些在实际应用中常见的基础用法。" class="headerlink" title="本篇文章主要总结一些在实际应用中常见的基础用法。"></a>本篇文章主要总结一些在实际应用中常见的基础用法。</h3><h3 id="主要内容：select、input-radio、input-checkbox"><a href="#主要内容：select、input-radio、input-checkbox" class="headerlink" title="主要内容：select、input:radio、input:checkbox"></a>主要内容：select、input:radio、input:checkbox</h3><h4 id="一、获取下拉列表选中的值"><a href="#一、获取下拉列表选中的值" class="headerlink" title="一、获取下拉列表选中的值 "></a>一、获取下拉列表选中的值 <img src="/images/js/basic/select.gif" alt=""></h4><ul>
<li><p><strong>1、option为静态的。</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">&lt;select&gt;</span><br><span class="line">    &lt;option value=&quot;null&quot;&gt;-请选择-&lt;/option&gt;</span><br><span class="line">    &lt;option value=&quot;1&quot;&gt;第一个值&lt;/option&gt;</span><br><span class="line">    &lt;option value=&quot;2&quot;&gt;第二个值&lt;/option&gt;</span><br><span class="line">    &lt;option value=&quot;3&quot;&gt;第三个值&lt;/option&gt;</span><br><span class="line">&lt;/select&gt;</span><br><span class="line">&lt;div&gt;</span><br><span class="line">    &lt;span&gt;&lt;/span&gt;</span><br><span class="line">    &lt;p&gt;&lt;/p&gt;</span><br><span class="line">&lt;/div&gt;</span><br><span class="line">//=======================js代码=========================</span><br><span class="line">$(&apos;select&apos;).on(&apos;change&apos;,function()&#123;</span><br><span class="line">	if($(this).children(&apos;option&apos;).is(&apos;:selected&apos;))&#123;</span><br><span class="line">		$(&apos;span&apos;).html(`下拉项的value：$&#123;$(this).children(&apos;option:selected&apos;).val()&#125;`)</span><br><span class="line">		$(&apos;p&apos;).html(`下拉项的内容：$&#123;$(this).children(&apos;option:selected&apos;).text()&#125;`)</span><br><span class="line">	&#125;</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>2、动态添加option</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">for(var i=1;i&lt;6;i++)&#123;</span><br><span class="line">	var option=`&lt;option&gt;第$&#123;i&#125;个值&lt;/option&gt;`</span><br><span class="line">	$(&apos;select&apos;).append(option)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>要点：</strong> <strong><em><code>change</code>监听select是否发生改动；<code>is(&#39;:selected&#39;)</code>is()方法，检测select是否被选中。</em></strong></p>
</li>
<li><strong>注意：</strong> 获取select下的value不是option的内容而是它的的value属性，这个value常用作一些状态或值等传到后台，而用text()或html()方法才是获取option的内容。</li>
<li><p><strong>小提示：</strong>select文字居中的样式：<code>text-align:center;text-align-last: center;</code><br><br></p>
<h4 id="二、单选框"><a href="#二、单选框" class="headerlink" title="二、单选框 "></a>二、单选框 <img src="/images/js/basic/radio.gif" alt=""></h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&lt;input type=&quot;radio&quot; value=&quot;1&quot; name=&quot;sex&quot; id=&quot;boy&quot;&gt;&lt;label for=&quot;boy&quot;&gt;男&lt;/label&gt;</span><br><span class="line">&lt;input type=&quot;radio&quot; value=&quot;0&quot; name=&quot;sex&quot; id=&quot;girl&quot;&gt;&lt;label for=&quot;girl&quot;&gt;女&lt;/label&gt;</span><br><span class="line">&lt;input type=&quot;radio&quot; value=&quot;3&quot; name=&quot;sex&quot; id=&quot;secret&quot;&gt;&lt;label for=&quot;secret&quot;&gt;保密&lt;/label&gt;</span><br><span class="line">&lt;button&gt;确定&lt;/button&gt;</span><br><span class="line">&lt;div&gt;&lt;/div&gt;</span><br><span class="line">//=======================js代码=========================</span><br><span class="line">$(&apos;button&apos;).click(()=&gt;&#123;</span><br><span class="line">    for(var i=0;i&lt;$(&apos;input&apos;).length;i++)&#123;</span><br><span class="line">        if($(&apos;input&apos;).eq(i).is(&apos;:checked&apos;))&#123;</span><br><span class="line">            $(&apos;div&apos;).html($(&apos;input&apos;).eq(i).val())</span><br><span class="line">        &#125;	</span><br><span class="line">    &#125;</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure>
</li>
<li><p><strong>要点：</strong> <strong><em>is(‘:checked’)检测是否被选中。</em></strong></p>
</li>
<li><strong>小提示：</strong>一组单选框怎么实现单选，请看<strong><a href="https://tilin.gitee.io/2018/08/31/html%20css/basis/" target="_blank" rel="noopener">这里</a></strong><br><br><h4 id="二、多选框"><a href="#二、多选框" class="headerlink" title="二、多选框 "></a>二、多选框 <img src="/images/js/basic/checkbox.gif" alt=""></h4></li>
<li><p>html代码：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&lt;div&gt;</span><br><span class="line">    &lt;button id=&quot;all&quot; onclick=&quot;All()&quot;&gt;全选&lt;/button&gt;</span><br><span class="line">    &lt;button id=&quot;null&quot; onclick=&quot;Null()&quot;&gt;不选&lt;/button&gt;</span><br><span class="line">    &lt;button id=&quot;reverse&quot; onclick=&quot;Reverse()&quot;&gt;反选&lt;/button&gt;</span><br><span class="line">&lt;/div&gt;</span><br><span class="line">&lt;input type=&quot;checkbox&quot; value=&quot;1&quot;  id=&quot;run&quot;&gt;&lt;label for=&quot;run&quot;&gt;跑步&lt;/label&gt;</span><br><span class="line">&lt;input type=&quot;checkbox&quot; value=&quot;2&quot;  id=&quot;bike&quot;&gt;&lt;label for=&quot;bike&quot;&gt;骑行&lt;/label&gt;</span><br><span class="line">&lt;input type=&quot;checkbox&quot; value=&quot;3&quot;  id=&quot;sing&quot;&gt;&lt;label for=&quot;sing&quot;&gt;跑步&lt;/label&gt;</span><br><span class="line">&lt;input type=&quot;checkbox&quot; value=&quot;4&quot;  id=&quot;swimming&quot;&gt;&lt;label for=&quot;swimming&quot;&gt;游泳&lt;/label&gt;</span><br><span class="line">&lt;div class=&quot;show&quot;&gt;&lt;/div&gt;</span><br></pre></td></tr></table></figure>
</li>
<li><p>原生js实现：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">var ipt=document.getElementsByTagName(&apos;input&apos;)</span><br><span class="line">function All()&#123;</span><br><span class="line">    for(var i=0;i&lt;ipt.length;i++)&#123;</span><br><span class="line">        ipt[i].checked=true</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">function Null()&#123;</span><br><span class="line">    for(var i=0;i&lt;ipt.length;i++)&#123;</span><br><span class="line">        ipt[i].checked=false</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">function Reverse()&#123;</span><br><span class="line">    for(var i=0;i&lt;ipt.length;i++)&#123;</span><br><span class="line">        ipt[i].checked=!ipt[i].checked</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>jQuery方法实现：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line">var ipt=$(&apos;input:checkbox&apos;)</span><br><span class="line">function All()&#123;</span><br><span class="line">    ipt.prop(&quot;checked&quot;,true)</span><br><span class="line">    show()</span><br><span class="line">&#125;</span><br><span class="line">function Null()&#123;</span><br><span class="line">    ipt.prop(&quot;checked&quot;,false)</span><br><span class="line">    show()</span><br><span class="line">&#125;</span><br><span class="line">function Reverse()&#123;</span><br><span class="line">    ipt.each((i,e)=&gt;&#123;</span><br><span class="line">        e.checked=!e.checked</span><br><span class="line">            // $(e).prop(&quot;checked&quot;,!$(e).prop(&quot;checked&quot;))</span><br><span class="line">            show()</span><br><span class="line">    &#125;)</span><br><span class="line">&#125;</span><br><span class="line">function show()&#123;</span><br><span class="line">    var showValueArr=[]</span><br><span class="line">    var showTextArr=[]</span><br><span class="line">    for(var i=0;i&lt;ipt.length;i++)&#123;</span><br><span class="line"></span><br><span class="line">        if(ipt.eq(i).is(&apos;:checked&apos;))&#123;</span><br><span class="line">            showValueArr.push(`$&#123;ipt.eq(i).val()&#125; `)</span><br><span class="line">            showTextArr.push(`$&#123;$(&apos;label&apos;).eq(i).html()&#125; `)</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    if(showValueArr)&#123;</span><br><span class="line">        $(&apos;.show&apos;).html(`value有：$&#123;showValueArr&#125;&lt;br /&gt;内容有：$&#123;showTextArr&#125;`)</span><br><span class="line">    &#125;</span><br><span class="line">    else&#123;</span><br><span class="line">        $(&apos;.show&apos;).html(&apos;&apos;)</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>jQuery方法写的较全。</p>
</li>
<li><strong>注意：</strong><a href="https://www.cnblogs.com/zhwl/p/3520162.html" target="_blank" rel="noopener">prop()和attr()的区别</a>，<a href="http://www.runoob.com/try/try.php?filename=tryjquery_html_prop_attr" target="_blank" rel="noopener">示例</a></li>
<li>以上用attr()设置checked和用removeAttr()去除checked按理来说没问题，也确实能够取得到值，但是会造成显示效果出错。把上面jQuery中的prop改为attr，如下图：<img src="/images/js/basic/becarfor.gif" alt=""></li>
</ul>

    </div>
</article>


<div id="comments-template"></div>
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script>
	if(!window.commentConfig) {
      window.commentConfig = {}
      window.commentConfig.title = 'JavaScript的一些常见基础用法（一）'
    }
</script>

                </div>
                <aside class="col-md-4 gal-left" id="sidebar">
    <!-- 此为sidebar的搜索框, 非搜索结果页面 -->
<aside id="sidebar-search">
    <div class="search hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <form class="form-inline clearfix" id="search-form" method="get"
              action="/search/index.html">
            <input type="text" name="s" class="form-control" id="searchInput" placeholder="搜索文章~">
            <button class="btn btn-danger btn-gal" type="submit">
                <i class="fa fa-search"></i>
            </button>
        </form>
    </div>
</aside>
    <aside id="sidebar-author">
    <div class="panel panel-gal" data-aos="flip-right" data-aos-duration="3000">
        <div class="panel-heading" style="text-align: center">
            <i class="fa fa-quote-left"></i>
            二口丝连连二口，十八相与与十八
            <i class="fa fa-quote-right"></i>
        </div>
        <div class="author-panel text-center">
            <img src="/imgs/avatar.jpg" width="140" height="140"
                 alt="个人头像" class="author-image">
            <p class="author-description"><h3 style="text-decoration:underline;"><p>一花一草一世界</p>
</h3></p>
        </div>
    </div>
</aside>
    
    <aside id="sidebar-recent_comments">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-comments"></i>
            最新评论
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush"></ul>
    </div>
</aside>
    
    <!-- 要配置好leancloud才能开启此小工具 -->
    
    
    <aside id="sidebar-recent_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            近期文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/11/14/javascript/js_copy/">JS复制选中的内容</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/11/13/audio video/mp4_play/">MP4网页播放器</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/11/13/html css/underlineStyle/">设置下划线样式</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/website/learning_website/">学习网站 学习社区</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/web/angular_upgrade/">AngularJs+Bootstrap搭建首页导航路由（升级）</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/vue/vue_cli/">Vue-cli脚手架工具搭建项目（详细）</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/web/angular/">AngularJs+Bootstrap搭建首页导航路由</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/vue/vue_babel/">Vue项目引入的一些包</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/tools/tools/">电脑实用的一些工具软件</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/plugins/cool-plugins/">炫酷特效插件</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="sidebar-rand_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            随机文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/audio video/mp4_attention/">MP4转码在网页播放要注意的两个坑</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/audio video/audio_video/">音频、视频特别注意</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/hexo/hexo_show/">hexo博客添加点击出现桃心效果 ❤❤❤</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/javascript/basic2/">JavaScript的一些常见基础用法（二）</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/javascript/basic1/">JavaScript的一些常见基础用法（一）</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/plugins/plugins/">实用插件</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/vue/vue_cli/">Vue-cli脚手架工具搭建项目（详细）</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/web/angular/">AngularJs+Bootstrap搭建首页导航路由</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/website/learning_website/">学习网站 学习社区</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/03/05/web/angular_upgrade/">AngularJs+Bootstrap搭建首页导航路由（升级）</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="gal-sets">
        <div class="panel panel-gal hidden-xs" data-aos="fade-up" data-aos-duration="2000">
            <ul class="nav nav-pills pills-gal">
                <li class="">
                    <a href="/2019/03/05/javascript/basic1/index.html#sidebar-tags" data-toggle="tab" id="tags-tab">热门标签</a>
                </li>
                <li class="">
                    <a href="/2019/03/05/javascript/basic1/index.html#sidebar-friend-links" data-toggle="tab" id="friend-links-tab">友情链接</a>
                </li>
                <li class="">
                    <a href="/2019/03/05/javascript/basic1/index.html#sidebar-links" data-toggle="tab" id="links-tab">个人链接</a>
                </li>
            </ul>
            <div class="tab-content">
                <div class="cloud-tags tab-pane nav bs-sidenav fade" id="sidebar-tags">
    
    <a href="/tags/audio-video/" style="font-size: 18.569670419195937px;" class="tag-cloud-link">audio video</a>
    
    <a href="/tags/funny/" style="font-size: 9.534085970014093px;" class="tag-cloud-link">funny</a>
    
    <a href="/tags/hexo/" style="font-size: 18.707906456634245px;" class="tag-cloud-link">hexo</a>
    
    <a href="/tags/html-css/" style="font-size: 14.536435095460188px;" class="tag-cloud-link">html css</a>
    
    <a href="/tags/markdown/" style="font-size: 16.63284183593767px;" class="tag-cloud-link">markdown</a>
    
    <a href="/tags/javascript/" style="font-size: 17.244844187752886px;" class="tag-cloud-link">javascript</a>
    
    <a href="/tags/琐记/" style="font-size: 11.251927585868255px;" class="tag-cloud-link">琐记</a>
    
    <a href="/tags/特效插件/" style="font-size: 14.963213560641524px;" class="tag-cloud-link">特效插件</a>
    
    <a href="/tags/实用插件/" style="font-size: 12.187579917855121px;" class="tag-cloud-link">实用插件</a>
    
    <a href="/tags/vue/" style="font-size: 16.31894276643185px;" class="tag-cloud-link">vue</a>
    
    <a href="/tags/tools/" style="font-size: 12.392888607097806px;" class="tag-cloud-link">tools</a>
    
    <a href="/tags/web/" style="font-size: 19.554657608390116px;" class="tag-cloud-link">web</a>
    
    <a href="/tags/学习网站-学习社区/" style="font-size: 17.631175138511903px;" class="tag-cloud-link">学习网站 学习社区</a>
    
</div>
                <div class="friend-links tab-pane nav bs-sidenav fade" id="sidebar-friend-links">
    
    <li>
        <a href="https://hexo.io/zh-cn/" target="_blank">Hexo</a>
    </li>
    
    <li>
        <a href="https://www.npmjs.com/" target="_blank">npm</a>
    </li>
    
    <li>
        <a href="https://user.qzone.qq.com/3287108795?source=namecardhoverqzone" target="_blank">个人空间（非好友可能看不了）</a>
    </li>
    
</div>
                <div class="links tab-pane nav bs-sidenav fade" id="sidebar-links">
    
    <li>
        <a href="https://github.com/tianrenlin/" target="_blank">Github</a>
    </li>
    
    <li>
        <a href="https://gitee.com/tilin" target="_blank">Gitee（码云）</a>
    </li>
    
    <li>
        <a href="https://segmentfault.com/u/tianlin" target="_blank">SegmentFault（思否）</a>
    </li>
    
</div>
            </div>
        </div>
    </aside>
    
</aside>
            </div>
        </div>
    </div>
    <footer id="gal-footer">
    <div class="container">
        Copyright © 2018 <a href="https://tilin.gitee.io/about/" style="color:#39C1D8;">Tlin</a> Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>.&nbsp;
    </div>
</footer>

<!-- 回到顶端 -->
<div id="gal-gotop" title="回到顶部">
    <i class="fa fa-angle-up"></i>
</div>
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":null,"use":"live2d-widget-model-z16","mobile":{"show":false},"dialog":{"enable":true},"log":false});</script></body>
<script src="/js/activate-power-mode.js"></script>
<script>

    // 配置highslide
	hs.graphicsDir = '/js/highslide/graphics/'
    hs.outlineType = "rounded-white";
    hs.dimmingOpacity = 0.8;
    hs.outlineWhileAnimating = true;
    hs.showCredits = false;
    hs.captionEval = "this.thumb.alt";
    hs.numberPosition = "caption";
    hs.align = "center";
    hs.transitions = ["expand", "crossfade"];
    hs.lang.number = '共%2张图, 当前是第%1张';
    hs.addSlideshow({
      interval: 5000,
      repeat: true,
      useControls: true,
      fixedControls: "fit",
      overlayOptions: {
        opacity: 0.75,
        position: "bottom center",
        hideOnMouseOut: true
      }
    })

    // 初始化aos
    AOS.init({
      duration: 1000,
      delay: 0,
      easing: 'ease-out-back'
    });

</script>
<script>
	POWERMODE.colorful = 'true';    // make power mode colorful
	POWERMODE.shake = 'true';       // turn off shake
	// TODO 这里根据具体情况修改
	document.body.addEventListener('input', POWERMODE);
</script>
<script>
    window.slideConfig = {
      prefix: '/imgs/slide/background',
      ext: 'jpg',
      maxCount: '6'
    }
</script>
<script src="/js/hs.js"></script>
<script src="/js/blog.js"></script>

<script src="/js/oni.js"></script>



<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
    if(window.commentConfig) {
      window.commentConfig.id = 'Tue Mar 05 2019 23:00:21 GMT+0800'
      window.commentConfig.owner = 'tianrenlin'
      window.commentConfig.repo = 'tilin_comments'
      window.commentConfig.client_id = 'a1c64988f8052e784d45'
      window.commentConfig.client_secret = 'a7eb4fff9e6c2d418ae487de38e3153bfe17c06c'
      window.commentConfig.redirect_uri = ''
    } else {
      window.commentConfig = {
      	id: 'Tue Mar 05 2019 23:00:21 GMT+0800',
        owner: 'tianrenlin',
        repo: 'tilin_comments',
        client_id: 'a1c64988f8052e784d45',
        client_secret: 'a7eb4fff9e6c2d418ae487de38e3153bfe17c06c',
        redirect_uri: ''
      }
    }
</script>
<script src="/js/comment/gitment.js"></script>

</html>
<script>
    !function(e,t,a){function n(){c(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),o(),r()}function r(){for(var e=0;e<d.length;e++)d[e].alpha<=0?(t.body.removeChild(d[e].el),d.splice(e,1)):(d[e].y--,d[e].scale+=.004,d[e].alpha-=.013,d[e].el.style.cssText="left:"+d[e].x+"px;top:"+d[e].y+"px;opacity:"+d[e].alpha+";transform:scale("+d[e].scale+","+d[e].scale+") rotate(45deg);background:"+d[e].color+";z-index:99999");requestAnimationFrame(r)}function o(){var t="function"==typeof e.onclick&&e.onclick;e.onclick=function(e){t&&t(),i(e)}}function i(e){var a=t.createElement("div");a.className="heart",d.push({el:a,x:e.clientX-5,y:e.clientY-5,scale:1,alpha:1,color:s()}),t.body.appendChild(a)}function c(e){var a=t.createElement("style");a.type="text/css";try{a.appendChild(t.createTextNode(e))}catch(t){a.styleSheet.cssText=e}t.getElementsByTagName("head")[0].appendChild(a)}function s(){return"rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"}var d=[];e.requestAnimationFrame=function(){return e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)}}(),n()}(window,document);
</script>